﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GraphCompiler.Core.ObjectModel.DiagramModel
{
    public class Diagram
    {
        IList<Box> _boxes = new List<Box>();

        public void AddBox(Box box)
        {
            _boxes.Add(box);
        }

        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return false;
            }

            var other = (Diagram)obj;

            if (_boxes.Count != other._boxes.Count)
                return false;

            for (int i = 0; i < _boxes.Count; i++)
            {
                if (!_boxes[i].Equals(other._boxes[i]))
                    return false;
            }

            return true;
        }
    }
}
